﻿using System;
using HttpApiGateway.Interface;
using HttpApiGateway.Model;

namespace HttpApiGateway.Service
{
    [RpcClient.Attr.ClassLifetimeAttr(RpcClient.Attr.ClassLifetimeType.单例)]
    internal class RouteService : ApiRouteService, IRouteService
    {
        public bool RegApi(RouteSet route, Action<IApiService> action)
        {
            return base.RegApi(action.Method, route);
        }
        public bool RegApi<T>(RouteSet route, Action<IApiService, T> action)
        {
            return base.RegApi(action.Method, route);
        }
        public bool RegApi<T>(RouteSet route, Func<IApiService, T, IResponse> action)
        {
            return base.RegApi(action.Method, route);
        }
        public bool RegApi(RouteSet route, Func<IApiService, IResponse> action)
        {
            return base.RegApi(action.Method, route);
        }
        public bool RegApi<T, Result>(RouteSet route, Func<IApiService, T, Result> action)
        {
            return base.RegApi(action.Method, route);
        }
        public bool RegApi<Result>(RouteSet route, Func<IApiService, Result> action)
        {
            return base.RegApi(action.Method, route);
        }

        public bool RegApi(RouteSet route, Action action)
        {
            return base.RegApi(action.Method, route);
        }
        public bool RegApi<T>(RouteSet route, Action<T> action)
        {
            return base.RegApi(action.Method, route);
        }
        public bool RegApi<T>(RouteSet route, Func<T, IResponse> action)
        {
            return base.RegApi(action.Method, route);
        }
        public bool RegApi(RouteSet route, Func<IResponse> action)
        {
            return base.RegApi(action.Method, route);
        }
        public bool RegApi<T, Result>(RouteSet route, Func<T, Result> action)
        {
            return base.RegApi(action.Method, route);
        }
        public bool RegApi<Result>(RouteSet route, Func<Result> action)
        {
            return base.RegApi(action.Method, route);
        }
    }
}
